1. Field of the Invention
This invention relates generally to a data processing system for compressing image data, and more particularly to a system for compressing image data organized in multiple bit pixels.
2. Discussion of the Related Art
In an image processing system it is typically desirable to compress image data. If the image data is being stored, compression of the data conserves the amount of storage space used. If the image data is being transferred over a communication line, compression of the data reduces bandwidth requirements or reduces transmission time.
Many compressors employ a run-length encoder that encodes sections of the input data containing a run of zeros into a number indicating the number of zeros successively appearing in the input data. Another type of encoder uses a two dimensional encoding system that encodes based on a correlation in the vertical as well as the horizontal direction.
One or two dimensional encoding is suitable for image data because image data tends to have the same type of data within a given area. Before processing image data with a run-length encoder, however, it is desirable to precondition the data to increase the number of successive zeros with a "predictor". A predictor predicts the value of the next pixel on the basis of values of pixels already processed.
In the case of the image data of the plus 1 color in which monochromatic image information additively contains one color or the plus 2 color, when the color flag and gradation information are encoded, color image information infrequently appears, while text image information frequently appears. Particularly for the text image, data of white or black information, which frequently and successively appear, must be compressed in a high redundancy reduction efficiency; otherwise it is difficult to improve the redundancy reduction efficiency of the overall image data. For this reason, an approach to simply assign codes to the monochromatic image data and the color image data and apply the predictive encoding system to the encoding, fails to attain a satisfactory redundancy reduction efficiency.
FIG. 1 is a diagram of a proposed pixel code assignment. For the serial image data having 3 bits per pixel, as shown in FIG. 1, the least significant bit is used for a color flag, and the two low-order bits are used for expressing gradation.
The color flag is set to "0" for a monochromatic pixel or "1" for a color (red) pixel. In the case of the plus 1 color image, "000" is assigned to white; "001" to G1; "010" to G2; and "011" to black. "100" is assigned to white (or not used); "101", to red G1; "110" to red G2; and "111", to true red.
Using the pixel code assignment of FIG. 1, in text image, for example, when black data is successive, "011 011 011 . . . ," is difficult to encode such data directly with the run-length coding system. Further, there may be no predictor available to effictively make this series of bits easy to encode.